package com.itheima.reggie.test;


import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import org.junit.jupiter.api.Test;

import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;

public class jwttest {
	
	
	@Test
	public void contextLoads(){
		HashMap<String, Object> map = new HashMap<>();
		
		Calendar instance = Calendar.getInstance();
		instance.add(Calendar.SECOND,120);
		
		String token = JWT.create()
				.withClaim("username", "张三")
				.withExpiresAt(instance.getTime())
				.sign(Algorithm.HMAC256("IXKJ!@!S(AK"));
		System.out.println(token);
		
	}
}
